/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.purpose.mapper;

import com.koron.purpose.domain.JobsHazardLibrary;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface JobsHazardLibraryMapper {

    /**
     * 新增
     * @param bean
     * @return
     */
    Integer insert(JobsHazardLibrary bean);

    /**
     * 修改
     * @param bean
     * @return
     */
    Integer update(JobsHazardLibrary bean);

    /**
     * 删除
     * @param id
     * @return
     */
    Integer delete(@Param("id") String id);

    /**
     * 根据主键查详情
     * @param id
     * @return
     */
    JobsHazardLibrary queryOneById(@Param("id") String id);

    /**
     * 根据条件查列表
     * @param name 危害因素名称
     * @param description 危害因素描述
     * @param measures 危害因素防控措施
     * @param start 起始位置
     * @param rows 多少条
     * @return
     */
    List<JobsHazardLibrary> queryByCondition(@Param("corpCode") String corpCode, @Param("corpName") String corpName, @Param("name") String name, @Param("description") String description, @Param("measures") String measures,
                                             @Param("start") Integer start, @Param("rows") Integer rows);

    /**
     * 根据条件查总数
     * @param name 危害因素名称
     * @param description 危害因素描述
     * @param measures 危害因素防控措施
     * @return
     */
    Integer countByCondition(@Param("corpCode") String corpCode, @Param("corpName") String corpName, @Param("name") String name, @Param("description") String description, @Param("measures") String measures);

    /**
     * 是否存在同名的危害因素
     * @param name
     * @param id
     * @return
     */
    Integer isExitDoubleName(@Param("name") String name, @Param("id") String id);
}
